using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Data;
using TALoaders;
using TAAlert.CommonUtils;
using TAAlert.BackTest;
using TAAlert.Alerts;

namespace TAAlert.Tests
{
    using NUnit.Framework;

    [TestFixture]
    class TestMACDandVEMA
    {
        [Test]
        [Category("Calculation")]
        public void calculateMacdLines()
        {
            List<double> value = this.getTmpPrices();
            int nEMAShort = 4;
            int nEMALong = 20;
            int nFast = 9;
            List<double> macdLine;
            List<double> macdSignal;
            List<double> macdHistogram;
            MACDEvaluator.calculateMacdLines(value, nEMAShort, nEMALong, nFast, out macdLine, out macdSignal, out macdHistogram);

            double[] mLine = { 0, 1.6170079051293, 3.6235072374815, 3.44631165447657, 2.29167840729374, 1.61405571769361, 2.76111267106138, 8.89477953194904, 17.4677617031051, 16.8318026287907, 10.7809350527596, 5.99738148155825, 5.77476571606285, 16.8134700310558, 39.6989289645714, 44.0833618594382, 29.1812372191204, 14.6987302518441, 9.08958839247697, 23.3655282190373, };
            List<double> macdLineExp = new List<double>(mLine);
            double[] mSig = { 0, 0.323401581025861, 0.983422712316989, 1.4760005007489, 1.63913608205787, 1.63412000918502, 1.85951854156029, 3.26657073963804, 6.10680893233145, 8.2518076716233, 8.75763314785055, 8.20558281459209, 7.71941939488624, 9.53822952212016, 15.5703694106104, 21.272967900376, 22.8546217641249, 21.2234434616687, 18.7966724478304, 19.7104436020717, };
            List<double> macdSigExp = new List<double>(mSig);
            double[] mHist = { 0, 1.29360632410344, 2.64008452516451, 1.97031115372766, 0.652542325235868, -0.0200642914914124, 0.90159412950109, 5.628208792311, 11.3609527707736, 8.5799949571674, 2.02330190490901, -2.20820133303384, -1.94465367882339, 7.27524050893565, 24.128559553961, 22.8103939590622, 6.32661545499557, -6.52471320982459, -9.70708405535339, 3.65508461696556, };
            List<double> macdHistExp = new List<double>(mHist);

            Assert.That(macdLine, Is.EqualTo(macdLineExp).Within(0.00001), "MACD Line");
            Assert.That(macdSignal, Is.EqualTo(macdSigExp).Within(0.00001), "MACD Signal");
            Assert.That(macdHistogram, Is.EqualTo(macdHistExp).Within(0.00001), "MACD Historgram");
        }

        [Test]
        [Category("Calculation")]
        public void calcMacdHistogram()
        {
            int nShort = 5;
            int nLong = 15;
            int nFast = 10;
            double tolerance = 0.0000000001;
            List<double> value = this.getTmpPrices();

            List<double> macdHist = MACDEvaluator.calcMacdHistogram(value, nShort, nLong, nFast);
            List<double> mHistExp = new List<double>(new double[] { 0,	0.90439895262026,	1.8955824644096,	1.50809003631272,	0.606291631776242,	0.0924611565334816,	0.680821851581338,	3.98489777574036,	8.17293657296977,	6.55233616504326,	2.0417207688885,	-1.1442280384967,	-1.27506583257794,	4.98520555453359,	17.0122813401543,	16.8846402672131,	5.76568301545205,	-3.64840528137817,	-6.66011632286305,	2.07328204784997});
            Assert.That(macdHist, Is.EqualTo(mHistExp).Within(tolerance), "1: MACD Histogram");
            List<double> macdHist2 = MACDEvaluator.calcMacdHistogramDEPRECIATED(value, nShort, nLong, nFast);
            Assert.That(macdHist2, Is.EqualTo(mHistExp).Within(tolerance), "2: MACD Histogram");
        }

        [Test]
        [Category("Calculation")]
        public void calcMacdStrategy()
        {
            int nShort = 4;
            int nLong = 20;
            int nFast = 9;
            DateTime startDate = new DateTime(2010,1,1);
            DateTime endDate = new DateTime(2010,1,20);
            SortedList<DateTime, double> prices = this.getTmpDatedPrices();
            
            MACDStrategy macdStr = new MACDStrategy(nShort, nLong, nFast,startDate , endDate, prices);
            SortedList<DateTime, int> pos = macdStr.generate();

            List<int> posExp = new List<int>(new int[]{0, 	1, 	1, 	1, 	1, 	-1, 	1, 	1, 	1, 	1, 	1, 	-1, 	-1, 	1, 	1, 	1, 	1, 	-1, 	-1, 	1});
            Assert.AreEqual(posExp, pos.Values, "MACDStrategy.generate()");
        }

        [Test]
        [Category("Calculation")]
        public void BackTestManagerMACDStrategy()
        {
            DateTime startDate = new DateTime(2009, 11, 30);
            DateTime endDate = new DateTime(2010, 5, 31);
            int nShortMIN = 2;
            int nShortMAX = 3;
            int nShortSTEP = 1;
            int nLongMIN = 3;
            int nLongMAX = 5;
            int nLongSTEP = 1;
            int nFastMIN = 4;
            int nFastMAX = 4;
            int nFastSTEP = 1;
            double tc = 0;
            QuoteType sigType = QuoteType.AdjClose;
            bool calcMonthly = true;
            bool calcYearly = true;

            BackTestManager btManager = new BackTestManager("^OMX", Loader.Test, startDate, endDate, tc, sigType, calcYearly, calcMonthly);
            List<BackTestManager.MACDPerfSummary> result = btManager.backTestMACDStrategy(nShortMIN, nShortMAX, nShortSTEP, nLongMIN, nLongMAX, nLongSTEP, nFastMIN, nFastMAX, nFastSTEP);

            // test number of elements in the list
            Assert.AreEqual(5, result.Count, "result.Count");

            // ==> test the nShort=2, nLong=3, nFast=4 <==
            Assert.AreEqual(2, result[0].NEmaShort, "nShort[0]");
            Assert.AreEqual(3, result[0].NEmaLong, "nLong[0]");
            Assert.AreEqual(4, result[0].NFast, "nFastSTEP[0]");

            double tolerance = 0.0000001;
            //  Total Figures
            Assert.AreEqual(-276.5600, result[0].Summary.Total.ProfitLoss, tolerance, "Total PL , nShort=2, nLong=3, nFast=4");
            Assert.AreEqual(-322.7300, result[0].Summary.Total.MaxDrawDown, tolerance, "Total MaxDD , nShort=2, nLong=3, nFast=4");
            Assert.AreEqual(-0.856939237, result[0].Summary.Total.Calmar, tolerance, "Total MaxDD , nShort=2, nLong=3, nFast=4");

            // Yearly Summary Test
            Assert.AreEqual(2, result[0].Summary.Yearly.Count, "Number of tested years");
            Assert.AreEqual(2009, result[0].Summary.Yearly[0].EndDate.Year, "Yearly: the first back-tested year");
            Assert.AreEqual(2010, result[0].Summary.Yearly[1].EndDate.Year, "Yearly: the second back-tested year");
            //  Yearly 2009
            PerfStatistics stat2009 = result[0].Summary.Yearly[0];
            Assert.AreEqual(-31.6000, stat2009.ProfitLoss, tolerance, "yearly 2009 PL: nShort=2, nLong=3, nFast=4");
            Assert.AreEqual(-59.1300, stat2009.MaxDrawDown, tolerance, "yearly 2009 MaxDD: nShort=2, nLong=3, nFast=4");
            Assert.AreEqual(-0.534415694, stat2009.Calmar, tolerance, "yearly 2009 Calmar: nShort=2, nLong=3, nFast=4");
            // Monthly
            Assert.AreEqual(6, result[0].Summary.Monthly.Count, "Number of tested Month");
            PerfStatistics statJan2010 = result[0].Summary.Monthly[1];
            Assert.AreEqual(-15.8300, statJan2010.ProfitLoss, tolerance, "monthly Jan2010 PL: nShort=2, nLong=2, nFast=4");
            Assert.AreEqual(-74.0200, statJan2010.MaxDrawDown, tolerance, "monthly Jan2010 maxDD: nShort=2, nLong=2, nFast=4");
            Assert.AreEqual(-0.213861119, statJan2010.Calmar, tolerance, "monthly Jan2010 Calmar: nShort=2, nLong=2, nFast=4");
            // MOnthly nShort=3, nLong=4, nFast=4
            Assert.AreEqual(3, result[2].NEmaShort, "nShort[2]");
            Assert.AreEqual(4, result[2].NEmaLong, "nLong[2]");
            Assert.AreEqual(4, result[2].NFast, "nFastSTEP[2]");
            statJan2010 = result[2].Summary.Monthly[1];
            Assert.AreEqual(-36.3900, statJan2010.ProfitLoss, tolerance, "monthly Jan2010 PL: nShort=3, nLong=4, nFast=4");
            Assert.AreEqual(-74.0200, statJan2010.MaxDrawDown, tolerance, "monthly Jan2010 maxDD: nShort=3, nLong=4, nFast=4");
            Assert.AreEqual(-0.491623885, statJan2010.Calmar, tolerance, "monthly Jan2010 Calmar: nShort=3, nLong=4, nFast=4");

            // Test longer steps:
            nShortMIN = 2;
            nShortMAX = 6;
            nShortSTEP = 3;
            nLongMIN = 3;
            nLongMAX = 7;
            nLongSTEP = 2;
            nFastMIN = 4;
            nFastMAX = 7;
            nFastSTEP = 2;
            startDate = new DateTime(2010, 5, 1);
            endDate = new DateTime(2010, 6, 15);
            result = btManager.backTestMACDStrategy(nShortMIN, nShortMAX, nShortSTEP, nLongMIN, nLongMAX, nLongSTEP, nFastMIN, nFastMAX, nFastSTEP);
            Assert.AreEqual(8, result.Count, "result.Count");
        }

        [Test]
        [Category("Calculation")]
        public void BackTestDTBuilderMACD()
        {
            DateTime startDate = new DateTime(2009, 11, 30);
            DateTime endDate = new DateTime(2010, 5, 31);
            int nShortMIN = 2;
            int nShortMAX = 3;
            int nShortSTEP = 1;
            int nLongMIN = 3;
            int nLongMAX = 4;
            int nLongSTEP = 1;
            int nFastMIN = 4;
            int nFastMAX = 5;
            int nFastSTEP = 1;
            double tc = 0.01;
            QuoteType sigType = QuoteType.AvgHLC;
            bool calcMonthly = true;
            bool calcYearly = true;

            BackTestManager btManager = new BackTestManager("^OMX", Loader.Test, startDate, endDate, tc, sigType, calcYearly, calcMonthly);
            List<BackTestManager.MACDPerfSummary> result = btManager.backTestMACDStrategy(nShortMIN, nShortMAX, nShortSTEP, nLongMIN, nLongMAX, nLongSTEP, nFastMIN, nFastMAX, nFastSTEP);

            BackTestDataTableBuilder dtBuilder = new BackTestDataTableBuilder();
            DataTable dTable = dtBuilder.createMACDDataTable(result, calcYearly, calcMonthly);

            string tmpFileName = "tmpBTDTBuilderMACD.csv";
            string referenceCacheFile = "..\\..\\Tests\\BTDTBuilderMACD.csv";
            Utilities.saveDataTableToCSV(tmpFileName, dTable);
            FileAssert.AreEqual(referenceCacheFile, tmpFileName, "0: comparing " + tmpFileName + " with " + referenceCacheFile);
            File.Delete(tmpFileName);
        }

        [Test]
        [Category("Calculation")]
        public void testMACDAlert()
        {
            BaseLoader loader = new TestDownloader();
            string ticker = "SEB";
            int nShort = 4;
            int nLong = 16;
            int nFast = 9;
            Alert macdAlert = new MACDAlert(loader, ticker, nShort, nLong, nFast);
            string[] info;
            // test Signal
            Signal sig = macdAlert.evalAlert(out info);
            Assert.AreEqual(Signal.Buy, sig, "MACD evalAlert signal");

            // test info
            Assert.AreEqual(13, info.Length, "MACD Alert info size");
            Assert.AreEqual("Price = 988.46", info[0].Substring(0, 14), "MACDAlert info[0]");
            string infoExp = string.Format("emaShort({0}) = {1:.####}", nShort, 990.311848);
            Assert.AreEqual(infoExp, info[1], "MACDAlert info[1]");
            infoExp = string.Format("emaLong({0}) = {1:.####}", nLong, 984.050481);
            Assert.AreEqual(infoExp, info[2], "MACDAlert info[2]");
            infoExp = string.Format("macdLine = {0:.####}", 6.261367);
            Assert.AreEqual(infoExp, info[3], "MACDAlert info[3]");
            infoExp = string.Format("macdSignal = {0:.####}", -4.752974);
            Assert.AreEqual(infoExp, info[4], "MACDAlert info[4]");
            infoExp = string.Format("macdHist = {0:.####}", 11.014341);
            Assert.AreEqual(infoExp, info[5], "MACDAlert info[5]");
            infoExp = "Old Signal = Buy";
            Assert.AreEqual(infoExp, info[6], "MACDAlert info[6]");
            infoExp = string.Format("Old Price = {0:.####}", 1005.93);
            Assert.AreEqual(infoExp, info[7].Substring(0, 19), "MACDALert info[7]");
            infoExp = string.Format("Old emaShort({0}) = {1:.####}", nShort, 991.546414);
            Assert.AreEqual(infoExp, info[8], "MACDAlert info[8]");
            infoExp = string.Format("Old emaLong({0}) = {1:.####}", nLong, 983.462545);
            Assert.AreEqual(infoExp, info[9], "MACDAlert info[9]");
            infoExp = string.Format("Old macdLine = {0:.####}", 8.083869);
            Assert.AreEqual(infoExp, info[10], "MACDAlert info[10]");
            infoExp = string.Format("Old macdSignal = {0:.####}", -7.506559);
            Assert.AreEqual(infoExp, info[11], "MACDAlert info[11]");
            infoExp = string.Format("Old macdHist = {0:.####}", 15.590428);
            Assert.AreEqual(infoExp, info[12], "MACDAlert info[12]");

            // test Description
            string descExp = "MACD    : nShort=4       , nLong=16      , nFast=9       ";
            Assert.AreEqual(descExp, macdAlert.Description, "MACDALert.Description");

            // oldAlert
            Assert.AreEqual(Signal.Buy, macdAlert.oldAlert(), "MACDAlert.oldAlert");
        }

        [Test]
        [Category("Calculation")]
        public void testVEMAGenerate()
        {
            int n1 = 2;
            int n2 = 4;
            DateTime startDate = new DateTime(2010, 1, 1);
            DateTime endDate = new DateTime(2010, 1, 20);
            SortedList<DateTime, double> prices = this.getTmpDatedPrices();

            double volT = 75;
            VEMAStrategy vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            SortedList<DateTime, int> pos = vStrategy.generate();
            List<int> posExp = new List<int>(new int[] { 1,	1,	1,	1,	-1,	-1,	1,	1,	1,	-1,	-1,	-1,	1,	1,	1,	1,	-1,	-1,	-1,	1 });
            Assert.AreEqual(posExp, pos.Values, "volTreashold=50: VEMAStrategy.generate()");

            volT = 85;
            vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            pos = vStrategy.generate();
            posExp = new List<int>(new int[] { 1,	1,	1,	-1,	-1,	-1,	1,	1,	1,	-1,	-1,	-1,	1,	1,	1,	1,	-1,	-1,	-1,	1 });
            Assert.AreEqual(posExp, pos.Values, "volTreashold=70: VEMAStrategy.generate()");

            
            volT = 65;
            vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            pos = vStrategy.generate();
            posExp = new List<int>(new int[] { 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1});
            Assert.AreEqual(posExp, pos.Values, "volTreashold=70: VEMAStrategy.generate()");
        }

        [Test]
        [Category("Calculation")]
        public void testVEMAGenerateWithNeutral()
        {
            int n1 = 2;
            int n2 = 0;
            DateTime startDate = new DateTime(2010, 1, 1);
            DateTime endDate = new DateTime(2010, 1, 20);
            SortedList<DateTime, double> prices = this.getTmpDatedPrices();

            double volT = 75;
            VEMAStrategy vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            SortedList<DateTime, int> pos = vStrategy.generate();
            List<int> posExp = new List<int>(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1 });
            Assert.AreEqual(posExp, pos.Values, "n1=2, n2=0, volTreashold=50: VEMAStrategy.generate()");

            volT = 85;
            vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            pos = vStrategy.generate();
            posExp = new List<int>(new int[] { 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1 });
            Assert.AreEqual(posExp, pos.Values, "n1=2, n2=0, volTreashold=70: VEMAStrategy.generate()");


            volT = 65;
            vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            pos = vStrategy.generate();
            posExp = new List<int>(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, -1, 1 });
            Assert.AreEqual(posExp, pos.Values, "n1=2, n2=0, volTreashold=70: VEMAStrategy.generate()");

            n1 = 0;
            n2 = 4;
            volT = 75;
            vStrategy = new VEMAStrategy(n1, n2, volT, startDate, endDate, prices);
            pos = vStrategy.generate();
            posExp = new List<int>(new int[] { 1, 1, 1, 1, -1, -1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 });
            Assert.AreEqual(posExp, pos.Values, "n1=0, n2=4, volTreashold=50: VEMAStrategy.generate()");
        }

        [Test]
        [Category("Calculation")]
        public void BackTestManagerVEMAStrategy()
        {
            DateTime startDate = new DateTime(2009, 11, 30);
            DateTime endDate = new DateTime(2010, 5, 31);
            int n1MIN = 2;
            int n1MAX = 3;
            int n1STEP = 1;
            int n2MIN = 3;
            int n2MAX = 5;
            int n2STEP = 1;
            double volMIN = 0.1;
            double volMAX = 0.30001;
            double volStep = 0.1;
            double tc = 0;
            QuoteType sigType = QuoteType.AdjClose;
            bool calcMonthly = false;
            bool calcYearly = false;

            BackTestManager btManager = new BackTestManager("^OMX", Loader.Test, startDate, endDate, tc, sigType, calcYearly, calcMonthly);
            List<BackTestManager.VEMAPerfSummary> result = btManager.backTestVEMAStrategy(n1MIN, n1MAX, n1STEP, n2MIN, n2MAX, n2STEP, volMIN, volMAX, volStep);

            Assert.AreEqual(24, result.Count, "VEMA BackTest size");
            // result[0]: n1=2, n2=0, vol=10%
            Assert.AreEqual(2, result[0].NEma1, "0: n1=2");
            Assert.AreEqual(0, result[0].NEma2, "0: n2=0");
            Assert.AreEqual(volMIN, result[0].VolTreashold, "0: volT=0.1");
            Assert.AreEqual(0, result[0].Summary.Total.ProfitLoss, "0: Total PL"); 
            // result[1]: n1=2, n2=0, vol=20%
            Assert.AreEqual(2, result[1].NEma1, "1: n1=2");
            Assert.AreEqual(0, result[1].NEma2, "1: n2=0");
            Assert.AreEqual(0.2, result[1].VolTreashold, "1: volT=0.2");
            Assert.AreEqual(-0.8543606412869813d, result[1].Summary.Total.Calmar, "1: Total Calmar"); // Not checked. Just saved

            // Test result with PL=0 and maxDD=0
            btManager = new BackTestManager("SRM", Loader.Test, startDate, endDate, tc, sigType, calcYearly, calcMonthly);
            volMIN = 0.01; // too low. No positions expected
            volMAX = 0.01;
            result = btManager.backTestVEMAStrategy(2, 2, 1, 3, 3, 1, volMIN, volMAX, volStep);
            Assert.AreEqual(2, result.Count, "2: VEMA BackTest size");
            // result[0]: n1=2, n2=0, vol=10%
            Assert.AreEqual(2, result[0].NEma1, "2: n1=2");
            Assert.AreEqual(0, result[0].NEma2, "2: n2=0");
            Assert.AreEqual(volMIN, result[0].VolTreashold, "2: volT=0.01");
            Assert.AreEqual(0, result[0].Summary.Total.ProfitLoss, "2: Total PL");
            Assert.AreEqual(0, result[0].Summary.Total.MaxDrawDown, "2: Total PL");
            Assert.AreEqual(0, result[0].Summary.Total.Calmar, "0: Total PL");
        }

        [Test]
        [Category("Calculation")]
        public void BackTestDTBuilderVEMA()
        {
            DateTime startDate = new DateTime(2009, 11, 30);
            DateTime endDate = new DateTime(2010, 5, 31);
            int n1MIN = 2;
            int n1MAX = 3;
            int n1STEP = 1;
            int n2MIN = 3;
            int n2MAX = 4;
            int n2STEP = 1;
            double volMIN = 0.1;
            double volMAX = 0.20001;
            double volStep = 0.1;
            double tc = 0.01;
            QuoteType sigType = QuoteType.AvgHL;
            bool calcMonthly = true;
            bool calcYearly = true;

            BackTestManager btManager = new BackTestManager("^OMX", Loader.Test, startDate, endDate, tc, sigType, calcYearly, calcMonthly);
            List<BackTestManager.VEMAPerfSummary> result = btManager.backTestVEMAStrategy(n1MIN, n1MAX, n1STEP, n2MIN, n2MAX, n2STEP, volMIN, volMAX, volStep);

            BackTestDataTableBuilder dtBuilder = new BackTestDataTableBuilder();
            DataTable dTable = dtBuilder.createVEMATable(result, calcYearly, calcMonthly);

            string tmpFileName = "tmpBTDTBuilderVEMA.csv";
            string referenceCacheFile = "..\\..\\Tests\\BTDTBuilderVEMA.csv";
            Utilities.saveDataTableToCSV(tmpFileName, dTable);
            FileAssert.AreEqual(referenceCacheFile, tmpFileName, "0: comparing " + tmpFileName + " with " + referenceCacheFile);
            File.Delete(tmpFileName);
        }

        private List<double> getTmpPrices()
        {
            double[] tmp = { 1, 6.30580718870553, 10.2114637801158, 6.50890224231367, 3.46668048903212, 3.58638131123781, 8.75893432003776, 27.1869725930217, 45.503323687665, 30.3294286955873, 13.7117968914565, 10.1414864873526, 18.6814059907179, 56.0205345710851, 113.552438389484, 92.1365012210124, 40.939553883418, 23.6108920649987, 32.8402021558916, 90.8106121978501 };
            return new List<double>(tmp);
        }

        private SortedList<DateTime, double> getTmpDatedPrices()
        {
            SortedList<DateTime, double> price = new SortedList<DateTime, double>();
            price.Add(new DateTime(2010, 1, 1), 1);
            price.Add(new DateTime(2010, 1, 2), 6.30580718870553);
            price.Add(new DateTime(2010, 1, 3), 10.2114637801158);
            price.Add(new DateTime(2010, 1, 4), 6.50890224231367);
            price.Add(new DateTime(2010, 1, 5), 3.46668048903212);
            price.Add(new DateTime(2010, 1, 6), 3.58638131123781);
            price.Add(new DateTime(2010, 1, 7), 8.75893432003776);
            price.Add(new DateTime(2010, 1, 8), 27.1869725930217);
            price.Add(new DateTime(2010, 1, 9), 45.503323687665);
            price.Add(new DateTime(2010, 1, 10), 30.3294286955873);
            price.Add(new DateTime(2010, 1, 11), 13.7117968914565);
            price.Add(new DateTime(2010, 1, 12), 10.1414864873526);
            price.Add(new DateTime(2010, 1, 13), 18.6814059907179);
            price.Add(new DateTime(2010, 1, 14), 56.0205345710851);
            price.Add(new DateTime(2010, 1, 15), 113.552438389484);
            price.Add(new DateTime(2010, 1, 16), 92.1365012210124);
            price.Add(new DateTime(2010, 1, 17), 40.939553883418);
            price.Add(new DateTime(2010, 1, 18), 23.6108920649987);
            price.Add(new DateTime(2010, 1, 19), 32.8402021558916);
            price.Add(new DateTime(2010, 1, 20), 90.8106121978501);
            return price;
        }
    }
}
